//
//  LanuchScreenViewController.swift
//  sonic
//
//  Created by Natsu on 15/03/2018.
//  Copyright © 2018 magicode. All rights reserved.
//

import UIKit

class LanuchScreenViewController: UIViewController {
    
    let launchView = UIStoryboard(name: "LaunchScreen", bundle: nil).instantiateViewController(withIdentifier: "LaunchScreen").view

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    override func viewDidAppear(_ animated: Bool) {
        let mainWindow = UIApplication.shared.keyWindow//获取到app的主屏幕
        launchView?.frame = (mainWindow?.frame)!
        mainWindow?.addSubview(launchView!)//将自定义的View加载在主屏上
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
